home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / OBJ1_2.ZIP;1 / C_BOX.TXT < prev    next >
Encoding:
Text File  |  1992-12-21  |  5.1 KB  |  153 lines

  1. '
  2. 'Class description:
  3. '
  4. !short:Box class structure:
  5. Class Box:
  6. ~~~~~~~~~~~
  7. This class is a predcessor of all classes, which are runing in a window
  8. on the screen. It enables simple blank window to be painted with label
  9. and shadow. The scrolling of text in the window is enabled. Method
  10. Box:GoodInit(...) takes care of inteligent placement of the window on
  11. the screen, nearest possible to the cursor but no required text is
  12. covered.
  13.  
  14. Common use:
  15. ~~~~~~~~~~~~~~~~~
  16. LOCAL OBJECT Box OF Box
  17. Box:Init(...)           //or Box:GoodInit(...)
  18. Box:Paint()
  19. Box:Done()
  20.  
  21. Source text is C_Box.prg
  22.  
  23. !short:~~~~~~~~~~~~~~~~~~~~~
  24. !short:create class Box from Loc
  25. !seealso: c_loc.ngo:Loc c_win.ngo:Win c_window.ngo:Window c_color.ngo:Color ob_class.ngo:"Class hierarchy"
  26.  
  27. !short:  export:
  28. !short:  var Name     //""
  29. ^BBox:Name^N: private: string
  30.   It stores window name string.
  31.  
  32. !short:  var RowSize  //MaxRow()-7
  33. ^BBox:RowSize^N: public: numeric
  34.  Number of lines of the window (window height).
  35.  
  36. !short:  var ColSize  //MaxCol()-9
  37. ^BBox:ColSize^N: public: numeric
  38.   Number of rows of the window (window width).
  39.  
  40. !short:  var Color    //m->Color:Edit
  41. ^BBox:Color^N: public: character
  42.   Colors used for painting of the window. Look at chapter Comands ØØ Constants
  43.   for detail description and to Public variable m->Color.
  44.  
  45. !short:  var Shadow   //true
  46. ^BBox:Shadow^N: public: logical
  47.   If true window is shadowed if false it isn't.
  48.  
  49. !short:  method New=BoxNew           //o:New() --> self
  50. ^BBox:New()^N: public: return self
  51.   Object is filled with default initialising values.
  52.  
  53. !short:  method Init=BoxInit         //o:Init(Name,R,C,Rs,Cs,Clr,Shd) --> true/false
  54. ^BBox:Init(Name,R,C,Rs,Cs,Clr,Shadow)^N: public: return true
  55.   Instvar object variables are initialised by recieved parameters.
  56.  
  57.   Parameter description
  58.   ~~~~~~~~~~~~~~~~~~~~~
  59.   ^UName^N: string: default is "", i.e. no title.
  60.    Window title.
  61.  
  62.   ^UR^N: numeric: default is 3.
  63.    Upper window border.
  64.  
  65.   ^UC^N: numeric: default is 4.
  66.    Left window border.
  67.  
  68.   ^URs^N: numeric: default is MaxRow()-7.
  69.    Window height in number of lines which fit the window.
  70.  
  71.   ^UCs^N: numeric: default is MaxCol()-9.
  72.    Window width in number of rows which fit the window.
  73.  
  74.   ^UClr^N: character: default is m->Color:Edit.
  75.    Window colors.
  76.  
  77.   ^UShadow^N: logical: default is true for color monitor, false for monochrom.
  78.    If true the shadow wil be painted.
  79.  
  80. !short:  method GoodInit=BoxGoodInit //o:GoodInit(Name,R,C,Rs,Cs,CurSize,Clr,Shd) --> true/false
  81. ^BBox:GoodInit(Name,R,C,Rs,Cs,CurSize,Clr,Shadow)^N: public: return true
  82.   Method Box:GoodInit(...)takes care of inteligent placement of the window
  83.   on the screen, nearest possible to the cursor but no required text
  84.   is covered. Certainly the window is placed so to be whole visible.
  85.  
  86.   Parameter description
  87.   ~~~~~~~~~~~~~~~~~~~~~
  88.  
  89.   ^UName^N: string: default is "", i.e. no title.
  90.    Window title.
  91.  
  92.   ^UR^N: numeric: default is Row().
  93.    Text position (row) on the screen which shouldn't be covered
  94.    by window, but the window should be as near as possible.
  95.  
  96.   ^UC^N: numeric: default is Col().
  97.    Text position (column) on the screen which shouldn't be covered
  98.    by window, but the window should be as near as possible.
  99.  
  100.   ^URs^N: numeric: default is MaxRow()-7.
  101.    Required height of the window in fitted lines.
  102.  
  103.   ^UCs^N: numeric: default is MaxCol()-9.
  104.    Required width of the window in fitted columns.
  105.  
  106.   ^UCurSize^N: numeric: default 1.
  107.    Width of the text which shouldn't be covered by window,
  108.    but the window should be as near as possible.
  109.  
  110.   ^UClr^N: character: default is m->Color:Edit.
  111.    Window colors.
  112.  
  113.   ^UShadow^N: logical: default is true for color monitor, false for monochrom.
  114.    If true the shadow will be painted.
  115.  
  116. !short:  method Paint=BoxPaint       //o:Paint(IsTop,lDouble) --> true
  117. ^BBox:Paint(IsTop,lDouble)^N: public: return true
  118.   Window is painted on the screen. Warning! the background is not saved.
  119.  
  120.   Parameter description:
  121.   ~~~~~~~~~~~~~~~~~~~~~
  122.   ^UIsTop^N: logical: default is true.
  123.    If true, the window title is painted in nTitle color (look at Commands
  124.     ØØ Constants); if false the title is painted in inside window character
  125.     colors (nNormal).
  126.  
  127.   ^UlDouble^N: logical: default is IsTop.
  128.    If true window frame is double lined, if false it's single lined.
  129.  
  130. !short:  method SayTitle=BoxSayTitle //o:SayTitle(IsTop) --> true
  131. ^BBox:SayTitle(IsTop)^N: public: return true
  132.   Window title is painted.
  133.  
  134.   ^UIsTop^N: logical: default is true.
  135.  
  136.   Parameter description:
  137.   ~~~~~~~~~~~~~~~~~~~~~
  138.   ^UIsTop^N: logical: default is true.
  139.    If true, the window title is painted in nTitle color (look at
  140.    Commands ØØ Constants); if false, the title is painted in inside window
  141.    character colors (nNormal).
  142.  
  143. !short:  method Scroll=BoxScroll     //o:Scroll(dRow) --> true
  144. ^BBox:Scroll(dRow)^N: public: return true
  145.   Text scrolling of given number (dRow) of lines.
  146.  
  147. !short:  method Done=BoxDone         //o:Done() --> true
  148. ^BBox:Done()^N: public: return true
  149.   Returns true, does nothing.
  150.  
  151. !short:  endclass
  152.  
  153.